/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package workforce.ui;

import java.util.Iterator;

/**
 *
 * @author TEComp
 */
public class UIText extends BaseUIWeb {
    private String name = null;
    private int id = 0;
    private Iterator attrs = null;
    
    public void setAttrs(Iterator attrs) {
        this.attrs = attrs;
    }
 
    public UIText() {
        skip(true);
    }

    
    @Override
    public String begin() {
        StringBuilder s = new StringBuilder();
        s.append("<input type=\"text\" name=\"");
        s.append(name).append("\" ");
        if( attrs != null ) {
        while( attrs.hasNext() ) {
            UIAttribute attr = (UIAttribute)attrs.next();
            s.append(" ").append(attr.print());
        }
        }
        s.append("\">\n");
        return s.toString();
    }

    @Override
    public String end() {
        return "";
        
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
}
